From ec88f89a15e555c41ee8f5b4fee2953b44ff8d42 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Sun, 21 Sep 2014 23:01:51 +0000 Subject: [PATCH] piggyback Qt codec on to cet_convert_init. fix encoding in garmin gpi reader and writer using piggybacked global codec. utilized piggybacked global codec in naviguide reader and writer. --- gpsbabel/cet/iso_8859_8.h | 156 ++++++++++++++++++ gpsbabel/cet_util.cc | 15 ++ gpsbabel/defs.h | 8 +- gpsbabel/garmin_gpi.cc | 27 +-- gpsbabel/internal_styles.cc | 8 +- gpsbabel/naviguide.cc | 21 +-- gpsbabel/reference/garmin_gpi_encoding.gpi | Bin 0 -> 1825 bytes gpsbabel/reference/garmin_gpi_encoding.gpx | 13 ++ .../reference/garmin_gpi_encoding2.gpi.gpx | 13 ++ gpsbabel/style/igo2008_poi.style | 2 +- gpsbabel/style/tomtom_asc.style | 2 +- gpsbabel/style/tomtom_itn.style | 2 +- gpsbabel/style/tomtom_itn_places.style | 2 +- gpsbabel/testo.d/garmin_gpi.test | 6 + 14 files changed, 236 insertions(+), 39 deletions(-) create mode 100644 gpsbabel/cet/iso_8859_8.h create mode 100644 gpsbabel/reference/garmin_gpi_encoding.gpi create mode 100644 gpsbabel/reference/garmin_gpi_encoding.gpx create mode 100644 gpsbabel/reference/garmin_gpi_encoding2.gpi.gpx diff --git a/gpsbabel/cet/iso_8859_8.h b/gpsbabel/cet/iso_8859_8.h new file mode 100644 index 000000000..e22f04a60 --- /dev/null +++ b/gpsbabel/cet/iso_8859_8.h @@ -0,0 +1,156 @@ +/* + + Data automatically generated from recode output: + + 'recode -lf "ISO-8859-8" 2>/dev/null' + + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA + +*/ + +#ifndef iso_8859_8_h +#define iso_8859_8_h + +#define cet_cs_name_iso_8859_8 "ISO-8859-8" + +const char *cet_cs_alias_iso_8859_8[] = +{ + "ISO-8859-8", "csISOLatinHebrew", "hebrew", "ISO8859-8", + "iso-ir-138", "ISO_8859-8", "ISO_8859-8:1988", NULL +}; + +#define cet_ucs4_ofs_iso_8859_8 161 +#define cet_ucs4_cnt_iso_8859_8 90 + +const int cet_ucs4_map_iso_8859_8[cet_ucs4_cnt_iso_8859_8] = +{ + -1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, + 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x203e, 0x00b0, + 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, + 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0x2017, 0x05d0, + 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, + 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, + 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, + 0x05e9, 0x05ea +}; + +#define cet_ucs4_to_iso_8859_8_ct 31 + +const cet_ucs4_link_t cet_ucs4_to_iso_8859_8_links[cet_ucs4_to_iso_8859_8_ct] = +{ + {0x00d7, 0xaa} /* sign */, + {0x00f7, 0xba} /* sign */, + {0x05d0, 0xe0} /* letter alef */, + {0x05d1, 0xe1} /* letter bet */, + {0x05d2, 0xe2} /* letter gimel */, + {0x05d3, 0xe3} /* letter dalet */, + {0x05d4, 0xe4} /* letter he */, + {0x05d5, 0xe5} /* letter vav */, + {0x05d6, 0xe6} /* letter zayin */, + {0x05d7, 0xe7} /* letter het */, + {0x05d8, 0xe8} /* letter tet */, + {0x05d9, 0xe9} /* letter yod */, + {0x05da, 0xea} /* letter final kaf */, + {0x05db, 0xeb} /* letter kaf */, + {0x05dc, 0xec} /* letter lamed */, + {0x05dd, 0xed} /* letter final mem */, + {0x05de, 0xee} /* letter mem */, + {0x05df, 0xef} /* letter final nun */, + {0x05e0, 0xf0} /* letter nun */, + {0x05e1, 0xf1} /* letter samekh */, + {0x05e2, 0xf2} /* letter ayin */, + {0x05e3, 0xf3} /* letter final pe */, + {0x05e4, 0xf4} /* letter pe */, + {0x05e5, 0xf5} /* letter final tsadi */, + {0x05e6, 0xf6} /* letter tsadi */, + {0x05e7, 0xf7} /* letter qof */, + {0x05e8, 0xf8} /* letter resh */, + {0x05e9, 0xf9} /* letter shin */, + {0x05ea, 0xfa} /* letter tav */, + {0x2017, 0xdf} /* low line */, + {0x203e, 0xaf} /* overline */ +}; + +/* +#define cet_ucs4_to_iso_8859_8_extra_ct 0 +const cet_ucs4_link_t cet_ucs4_to_iso_8859_8_extra[cet_ucs4_to_iso_8859_8_extra_ct] = {}; +*/ + +cet_cs_vec_t cet_cs_vec_iso_8859_8 = /* defined in cet.h */ +{ + cet_cs_name_iso_8859_8, /* name of character set */ + cet_cs_alias_iso_8859_8, /* alias table */ + + NULL, /* ... to UCS-4 converter (multi-byte) */ + NULL, /* UCS-4 to ... converter (multi-byte) */ + + cet_ucs4_map_iso_8859_8, /* char to UCS-4 value table */ + cet_ucs4_ofs_iso_8859_8, /* first non standard character */ + cet_ucs4_cnt_iso_8859_8, /* number of values in table */ + + cet_ucs4_to_iso_8859_8_links, /* UCS-4 to char links */ + cet_ucs4_to_iso_8859_8_ct, /* number of links */ + + NULL, /* hand made UCS-4 links */ + 0, /* number of extra links */ + + NULL /* for internal use */ +}; + + +/* +const int iso_8859_8_ucs4_full_map[] = +{ + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, -1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x203e, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, + 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0x2017, + 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, + 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, + 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, + 0x05e8, 0x05e9, 0x05ea, -1, -1, -1, -1, -1 +}; +*/ + +#endif diff --git a/gpsbabel/cet_util.cc b/gpsbabel/cet_util.cc index e357287e3..256f93dc8 100644 --- a/gpsbabel/cet_util.cc +++ b/gpsbabel/cet_util.cc @@ -31,6 +31,7 @@ #include "cet_util.h" #include +#include #define MYNAME "cet_util" @@ -50,6 +51,7 @@ static int cet_output = 0; #include "cet/ansi_x3_4_1968.h" #include "cet/cp1252.h" +#include "cet/iso_8859_8.h" /* %%% short hand strings transmission for main character sets %%% */ @@ -193,6 +195,10 @@ cet_register(void) #ifdef cet_cs_name_cp1252 cet_register_cs(&cet_cs_vec_cp1252); #endif +#ifdef cet_cs_name_iso_8859_8 + cet_register_cs(&cet_cs_vec_iso_8859_8); +#endif + if (cet_cs_vec_ct > 0) { cet_cs_vec_t* p; @@ -344,6 +350,7 @@ cet_convert_deinit(void) } global_opts.charset = NULL; global_opts.charset_name = NULL; + global_opts.codec = NULL; } void @@ -354,6 +361,14 @@ cet_convert_init(const char* cs_name, const int force) if (0 == cet_validate_cs(cs_name, &global_opts.charset, &global_opts.charset_name)) { fatal("Unsupported character set \"%s\"!\n", cs_name); } + if ((cs_name == NULL) || (strlen(cs_name) == 0)) { /* set default us-ascii */ + global_opts.codec = QTextCodec::codecForName(CET_CHARSET_ASCII); + } else { + global_opts.codec = QTextCodec::codecForName(cs_name); + } + if (!global_opts.codec) { + fatal("Unsupported character set \"%s\"!\n", cs_name); + } } } diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 9fec3d278..d9d4988d2 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -38,11 +38,14 @@ #include #include +#include #include # include "src/core/datetime.h" #define CSTR(qstr) (qstr.toUtf8().constData()) +#define STRFROMUNICODE(qstr) (global_opts.codec->fromUnicode(qstr).constData()) +#define STRTOUNICODE(cstr) (global_opts.codec->toUnicode(cstr)) /* * Amazingly, this constant is not specified in the standard... @@ -197,6 +200,7 @@ typedef struct { cet_cs_vec_t* charset; char* charset_name; inifile_t* inifile; + QTextCodec* codec; } global_options; extern global_options global_opts; @@ -988,8 +992,8 @@ const char* get_filename(const char* fname); /* extract the filename portion * #define CET_NOT_CONVERTABLE_DEFAULT '$' #define CET_CHARSET_ASCII "US-ASCII" #define CET_CHARSET_UTF8 "UTF-8" -#define CET_CHARSET_HEBREW "CP1255" -#define CET_CHARSET_MS_ANSI "MS-ANSI" +#define CET_CHARSET_HEBREW "ISO-8859-8" +#define CET_CHARSET_MS_ANSI "windows-1252" #define CET_CHARSET_LATIN1 "ISO-8859-1" #define str_utf8_to_cp1252(str) cet_str_utf8_to_cp1252((str)) diff --git a/gpsbabel/garmin_gpi.cc b/gpsbabel/garmin_gpi.cc index 253b8cf32..1b6334f58 100644 --- a/gpsbabel/garmin_gpi.cc +++ b/gpsbabel/garmin_gpi.cc @@ -71,6 +71,7 @@ static char* opt_cat, *opt_pos, *opt_notes, *opt_hide_bitmap, *opt_descr, *opt_bitmap; static char* opt_unique, *opt_alerts, *opt_units, *opt_speed, *opt_proximity, *opt_sleep; +static char* opt_writecodec; static double defspeed, defproximity; static int alerts; @@ -123,6 +124,10 @@ static arglist_t garmin_gpi_args[] = { "units", &opt_units, "Units used for names with @speed ('s'tatute or 'm'etric)", "m", ARGTYPE_STRING, ARG_NOMINMAX }, + { + "writecodec", &opt_writecodec, "codec to use for writing strings", + "windows-1252", ARGTYPE_STRING, ARG_NOMINMAX + }, ARG_TERMINATOR }; @@ -290,7 +295,7 @@ static QString gpi_read_string(const char* field) { char*s = gpi_read_string_old(field); - QString rv = QString::fromLatin1(s); + QString rv = STRTOUNICODE(s); xfree(s); return rv; } @@ -731,7 +736,7 @@ write_string(const char* str, const char long_format) static void write_string(const QString& str, const char long_format) { - write_string(CSTR(str), long_format); + write_string(STRFROMUNICODE(str), long_format); } @@ -1424,16 +1429,14 @@ load_bitmap_from_file(const char* fname, unsigned char** data, int* data_sz) static void garmin_gpi_rd_init(const char* fname) { - char cp[8]; - fin = gbfopen_le(fname, "rb", MYNAME); rdata = new reader_data_t; read_header(); if ((codepage >= 1250) && (codepage <= 1257)) { - snprintf(cp, sizeof(cp), "CP%d", codepage); - cet_convert_init(cp, 1); + QString qCodecName = QString("windows-%1").arg(codepage); + cet_convert_init(CSTR(qCodecName), 1); } else { fatal(MYNAME ": Unsupported code page (%d). File is likely encrypted.\n", codepage); } @@ -1448,8 +1451,6 @@ garmin_gpi_rd_init(const char* fname) static void garmin_gpi_wr_init(const char* fname) { - char cp[8]; - cet_cs_vec_t* vec; int i; if (gpi_timestamp != 0) { /* not the first gpi output session */ @@ -1478,19 +1479,19 @@ garmin_gpi_wr_init(const char* fname) codepage = 0; for (i = 1250; i <= 1257; i++) { - snprintf(cp, sizeof(cp), "CP%d", i); - vec = cet_find_cs_by_name(cp); - if (vec == global_opts.charset) { + if (QString("windows-%1").arg(i).compare(QString(opt_writecodec), Qt::CaseInsensitive) == 0) { codepage = i; break; } } if (! codepage) { - warning(MYNAME ": Unsupported character set (%s)!\n", global_opts.charset_name); - fatal(MYNAME ": Valid values are CP1250 to CP1257.\n"); + warning(MYNAME ": Unsupported character set (%s)!\n", opt_writecodec); + fatal(MYNAME ": Valid values are windows-1250 to windows-1257.\n"); } + cet_convert_init(opt_writecodec,1); + units = tolower(opt_units[0]); if ((units != 'm') && (units != 's')) { fatal(MYNAME ": Unknown units parameter (%c).\n", opt_units[0]); diff --git a/gpsbabel/internal_styles.cc b/gpsbabel/internal_styles.cc index 9c3edaebd..37152e953 100644 --- a/gpsbabel/internal_styles.cc +++ b/gpsbabel/internal_styles.cc @@ -715,7 +715,7 @@ static char igo2008_poi[] = "FIELD_DELIMITER PIPE\n" "RECORD_DELIMITER CRNEWLINE\n" "BADCHARS \"|\n" - "ENCODING MS-ANSI\n" + "ENCODING windows-1252\n" "#\n" "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n" "#\n" @@ -1282,7 +1282,7 @@ static char tomtom_asc[] = "FIELD_DELIMITER COMMA\n" "RECORD_DELIMITER CRNEWLINE\n" "BADCHARS ,\"\n" - "ENCODING MS-ANSI\n" + "ENCODING windows-1252\n" "#\n" "PROLOGUE TomTom Navigator Places of Interest\n" "PROLOGUE GPSBabel-__VERSION__ ASCII Export\n" @@ -1311,7 +1311,7 @@ static char tomtom_itn[] = "FIELD_DELIMITER PIPE\n" "RECORD_DELIMITER CRNEWLINE\n" "BADCHARS ,|\n" - "ENCODING MS-ANSI\n" + "ENCODING windows-1252\n" "#\n" "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n" "#\n" @@ -1336,7 +1336,7 @@ static char tomtom_itn_places[] = "FIELD_DELIMITER PIPE\n" "RECORD_DELIMITER CRNEWLINE\n" "BADCHARS ,|\n" - "ENCODING MS-ANSI\n" + "ENCODING windows-1252\n" "#\n" "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n" "#\n" diff --git a/gpsbabel/naviguide.cc b/gpsbabel/naviguide.cc index c99c00b5c..e10e2bfd6 100644 --- a/gpsbabel/naviguide.cc +++ b/gpsbabel/naviguide.cc @@ -26,7 +26,6 @@ #include #include #include -#include #define MYNAME "Naviguide" @@ -137,15 +136,10 @@ ng_fwrite_wp_data(const QString& s, const QString& d, ng_wp_data_t* wp_data, gbf int i; char z[50]; - QTextCodec* codec = QTextCodec::codecForName("Hebrew"); - if (!codec) { - fatal(MYNAME ": Unable to locate codec for Hebrew"); - } - memset(z, 0, 50); i = s.length(); gbfwrite(&i, 1, 1, f); - gbfwrite(codec->fromUnicode(s).constData(), 1, i, f); + gbfwrite(STRFROMUNICODE(s), 1, i, f); gbfwrite(&wp_data->pad1[0], 8, 1, f); gbfputint32(wp_data->East, f); @@ -155,7 +149,7 @@ ng_fwrite_wp_data(const QString& s, const QString& d, ng_wp_data_t* wp_data, gbf i = d.length(); gbfwrite(&i, 1, 1, f); - gbfwrite(codec->fromUnicode(d).constData(), 1, i, f); + gbfwrite(STRFROMUNICODE(d), 1, i, f); gbfwrite(z, 44, 1, f); } @@ -381,11 +375,6 @@ data_read(void) route_add_head(rte_head); } - QTextCodec* codec = QTextCodec::codecForName("Hebrew"); - if (!codec) { - fatal(MYNAME ": Unable to locate codec for Hebrew"); - } - for (int n = 0; n < nof_wp; ++n) { Waypoint* wpt_tmp = new Waypoint; @@ -413,8 +402,8 @@ data_read(void) /* put the data in the waypoint structure */ ng_convert_datum(wpt_tmp); - wpt_tmp->shortname = codec->toUnicode(WPNC.strName); - wpt_tmp->description = codec->toUnicode(strComment); + wpt_tmp->shortname = STRTOUNICODE(WPNC.strName); + wpt_tmp->description = STRTOUNICODE(strComment); if (process_rte) { route_add_wpt(rte_head, wpt_tmp); @@ -437,5 +426,5 @@ ff_vecs_t ng_vecs = { data_write, NULL, ng_args, - CET_CHARSET_ASCII, 0 // Hebrew, but explictly encoded. + CET_CHARSET_HEBREW, 0 }; diff --git a/gpsbabel/reference/garmin_gpi_encoding.gpi b/gpsbabel/reference/garmin_gpi_encoding.gpi new file mode 100644 index 0000000000000000000000000000000000000000..4619677fe01294e4a5ed8d4cfc73182243cfca44 GIT binary patch literal 1825 zcmeH{X-pee5Xb)nLct{THYsgNTD2(+A#u{Wq-ovSrN%`Bn_>zvgy7goQ)nnh3<2U@ zbBaqsfVe6^0)*fL_bmkC<^uw836QuXE+K9q0phIavz?#_xl+Hk^EA8jes6YWG;g#3 zz$7Ygc68?3vRD~^MO*_6;TwAGvA?$-IXOqvNn}r+EY^YnU<@Nn8UlWVoF~c`8pAR4 zlE0t#ABv|&B*rmW>XM&mzgN@Kq5`c;K!aAjB9h0CG`mw=!TG_J zRy&^Jfw$}hx;SMcp#CjaK5_c-z9?8*h9>?qV$-toIQxc?v4m9pBJbxP+)=5dXU<)* z`C0Dv?%fmqn>)|T>orpjkLUQy?+-4!xmjIjspCAOgd7f&&7TVcHqa(SDzy{^sN>MKUwC_)eN0{b?1~k2 z^MOe8)%SNab<(%3toY_!0cFE`>(l#oc8)T!mOl*$@Ok^|_xUoX+cf?B`8^MNEtlx& z89rnSzq|a=uPVNQ!J9AoN&gd9G8nHvq7(s2(uBME`c^0X_x1I&z9F@7% z!b#sKG26t#^hYHAA8)6 + + + + + + + € + ™ + ™ + Waypoint + + diff --git a/gpsbabel/reference/garmin_gpi_encoding2.gpi.gpx b/gpsbabel/reference/garmin_gpi_encoding2.gpi.gpx new file mode 100644 index 000000000..f2b158400 --- /dev/null +++ b/gpsbabel/reference/garmin_gpi_encoding2.gpi.gpx @@ -0,0 +1,13 @@ + + + + + + + + € + ™ + ™ + Waypoint + + diff --git a/gpsbabel/style/igo2008_poi.style b/gpsbabel/style/igo2008_poi.style index 477dc46a6..9a1e6a34f 100644 --- a/gpsbabel/style/igo2008_poi.style +++ b/gpsbabel/style/igo2008_poi.style @@ -13,7 +13,7 @@ DATATYPE WAYPOINT FIELD_DELIMITER PIPE RECORD_DELIMITER CRNEWLINE BADCHARS "| -ENCODING MS-ANSI +ENCODING windows-1252 # # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: # diff --git a/gpsbabel/style/tomtom_asc.style b/gpsbabel/style/tomtom_asc.style index 022936a9f..e8e738ae3 100644 --- a/gpsbabel/style/tomtom_asc.style +++ b/gpsbabel/style/tomtom_asc.style @@ -13,7 +13,7 @@ DATATYPE WAYPOINT FIELD_DELIMITER COMMA RECORD_DELIMITER CRNEWLINE BADCHARS ," -ENCODING MS-ANSI +ENCODING windows-1252 # PROLOGUE TomTom Navigator Places of Interest PROLOGUE GPSBabel-__VERSION__ ASCII Export diff --git a/gpsbabel/style/tomtom_itn.style b/gpsbabel/style/tomtom_itn.style index 2e1c9d93c..ec7b3975e 100644 --- a/gpsbabel/style/tomtom_itn.style +++ b/gpsbabel/style/tomtom_itn.style @@ -13,7 +13,7 @@ DATATYPE ROUTE FIELD_DELIMITER PIPE RECORD_DELIMITER CRNEWLINE BADCHARS ,| -ENCODING MS-ANSI +ENCODING windows-1252 # # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: # diff --git a/gpsbabel/style/tomtom_itn_places.style b/gpsbabel/style/tomtom_itn_places.style index 119afb803..106a16d09 100644 --- a/gpsbabel/style/tomtom_itn_places.style +++ b/gpsbabel/style/tomtom_itn_places.style @@ -13,7 +13,7 @@ DATATYPE ROUTE FIELD_DELIMITER PIPE RECORD_DELIMITER CRNEWLINE BADCHARS ,| -ENCODING MS-ANSI +ENCODING windows-1252 # # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: # diff --git a/gpsbabel/testo.d/garmin_gpi.test b/gpsbabel/testo.d/garmin_gpi.test index 8b9da3b59..8f6fcaeef 100644 --- a/gpsbabel/testo.d/garmin_gpi.test +++ b/gpsbabel/testo.d/garmin_gpi.test @@ -20,3 +20,9 @@ compare ${REFERENCE}/gpi_ext-sample.csv ${TMPDIR}/gpi_ext-sample.csv gpsbabel -i garmin_gpi -f ${REFERENCE}/umsonstdraussen.gpi -o gpx,gpxver=1.1 -F ${TMPDIR}/umsonstdraussen.gpx compare ${REFERENCE}/umsonstdraussen.gpx ${TMPDIR}/umsonstdraussen.gpx +# look for differnces between latin1 and windows-1252 +gpsbabel -i garmin_gpi -f ${REFERENCE}/garmin_gpi_encoding.gpi -o gpx,gpxver=1.1 -F ${TMPDIR}/garmin_gpi_encoding.gpx +compare ${REFERENCE}/garmin_gpi_encoding.gpx ${TMPDIR}/garmin_gpi_encoding.gpx +gpsbabel -i gpx -f ${REFERENCE}/garmin_gpi_encoding.gpx -o garmin_gpi -F ${TMPDIR}/garmin_gpi_encoding.gpi +gpsbabel -i garmin_gpi -f ${TMPDIR}/garmin_gpi_encoding.gpi -o gpx,gpxver=1.1 -F ${TMPDIR}/garmin_gpi_encoding2.gpi.gpx +compare ${REFERENCE}/garmin_gpi_encoding2.gpi.gpx ${TMPDIR}/garmin_gpi_encoding2.gpi.gpx -- 2.30.2